<head>

    <link rel="stylesheet" href="__STATIC__/pdf/jquery.touchPDF.css">
    <!-- 新 Bootstrap4 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">

    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>

    <!-- popper.min.js 用于弹窗、提示、下拉菜单 -->
    <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>

    <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
    <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
    <!-- 预览pdf组件 -->
    <script
            src="https://code.jquery.com/jquery-1.12.4.min.js"
            integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
            crossorigin="anonymous"></script>
    <script src="__STATIC__/pdf/jquery.mousewheel.js"></script>
    <script src="__STATIC__/pdf/jquery.panzoom.js"></script>
    <script src="__STATIC__/pdf/jquery.touchPDF.js"></script>
    <script src="__STATIC__/pdf/jquery.touchSwipe.js"></script>
    <script src="__STATIC__/pdf/pdf.compatibility.js"></script>
    <script src="__STATIC__/pdf/pdf.js"></script>
    <script src="__STATIC__/pdf/pdf.worker.js"></script>
</head>
<body>
<div class="container bg-white">
    <form onsubmit="return false">
        <div class="mt-3">
            <a href="{$path}" download="{$name}.pdf"><button type="button"  class="btn btn-success">下载</button></a>
            <button type="button" onclick="window.location.href='{$path}'" class="btn btn-danger">直接打开</button>
        </div>
    </form>
</div>
<div id="myPDF" class="col-12 bg-dark text-dark">

</div>
</body>
<script>
    $(function() {
        $("#myPDF").pdf({
            source: "{$path}",
            redrawOnWindowResize:true,
            color:'black',
            quality:1
        });
    });
</script>
</html>